import Vue from "vue";
import Vuex, { Store } from "vuex";
import config from "./config";
import permission from "./config/permission";
import auth from "./config/auth";
import setTheme from "./config/setTheme";
import dict from './config/dict';
import bpmn from './bpmn';

Vue.use(Vuex)


const store = new Store({
  modules: {
    config: {
      namespaced: true,
      ...config,
    },
    permission: {
      namespaced: true,
      ...permission,
    },
    auth: {
      namespaced: true,
      ...auth,
    },
    setTheme: {
      namespaced: true,
      ...setTheme,
    },
    dict: {
      namespaced: true,
      ...dict,
    },
    bpmn
  },

  getters: {
    mapPermissionFun: state => state.permission.mapPermissionFun,
    roleId: state => state.permission.roleId,
    stageId_global: state => state.permission.stageId_global,
    data_global: state => state.permission.data_global
  }
});
export default store;
